﻿<UserControl x:Class="Big3.Hitbase.CDCover.SelectCDCoverTrackFields"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Big3.Hitbase.CDCover"
             xmlns:sr="clr-namespace:Big3.Hitbase.SharedResources;assembly=Big3.Hitbase.SharedResources"
             mc:Ignorable="d" 
             Height="400" Width="600" >
    <UserControl.Resources>
        <local:TextAlignmentDisplayNameConverter x:Key="TextAlignmentDisplayNameConverter" />
    </UserControl.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions> 
        
        <StackPanel>
            <TextBlock Grid.Row="0" Text="Wählen Sie aus der folgenden Liste aus, welche Felder angezeigt werden sollen:" />
            <TextBlock Grid.Row="0" Text="Verfügbare Felder:" Margin="0,20,0,0" />
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <DataGrid Name="DataGridFields" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" HeadersVisibility="Column" RowHeaderWidth="0" SelectionUnit="FullRow" SelectionChanged="DataGridFields_SelectionChanged">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="Feldbezeichnung" Width="230" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <CheckBox IsChecked="{Binding IsChecked, UpdateSourceTrigger=PropertyChanged}" Margin="2,2,5,2" />
                                    <TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Header="Spaltenbreite" Binding="{Binding Width}" Width="100" IsReadOnly="True" />
                    <DataGridTextColumn Header="Ausrichtung" Binding="{Binding TextAlignment, Converter={StaticResource TextAlignmentDisplayNameConverter}}" Width="100" IsReadOnly="True" />
                </DataGrid.Columns>
            </DataGrid>
            <StackPanel Orientation="Vertical" Grid.Column="1">
                <Button Name="buttonMoveUp" Content="Nach oben" Padding="20,2" Margin="10,0,10,3" Click="buttonMoveUp_Click" />
                <Button Name="buttonMoveDown" Content="Nach unten" Padding="20,2" Margin="10,3" Click="buttonMoveDown_Click" />
                <Button Name="buttonDefault" Content="Standard" Padding="20,2" Margin="10,3" Click="buttonDefault_Click" />
            </StackPanel>
        </Grid>

        <StackPanel Grid.Row="2" >
            <StackPanel Orientation="Horizontal" Margin="0,5" >
                <TextBlock Width="100" Text="Spaltenbreite:" VerticalAlignment="Center" />
                <TextBox Width="100" Text="{Binding SelectedItem.Width, ElementName=DataGridFields}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal"  Margin="0,5" >
                <TextBlock Width="100" Text="Ausrichtung:" VerticalAlignment="Center"/>
                <ComboBox Width="100" Name="ComboBoxTextAlignment" SelectedValuePath="TextAlignment" SelectedValue="{Binding SelectedItem.TextAlignment, ElementName=DataGridFields}">
                    
                </ComboBox>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,5">
                <Button Name="ButtonOK" Content="{sr:Loc OK}" MinWidth="80" Margin="10,0,10,0" Click="ButtonOK_Click" />
                <Button Name="ButtonCancel" Content="{sr:Loc Cancel}"  MinWidth="80" Click="ButtonCancel_Click" />
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
